package Acoes;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import ControleCodeFactory.ControleCodeFactory;
import InterfaceGrafica.JanelaPrincipal;

public class AcaoDeProximoEvento extends AbstractAction{
	private JanelaPrincipal janelaPrincipal;
	
	public AcaoDeProximoEvento(JanelaPrincipal jp){
		janelaPrincipal = jp;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		try {
			ControleCodeFactory.getControle().avancaAteProximoEvento();
			
			//escreve o evento no painel
			String textoEvento = ControleCodeFactory.getControle().getTextoEvento();
			janelaPrincipal.getPainelDeEventos().atualizaEventos(textoEvento);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}	
	}

}